package com.zy.datareceiver.binsess.rabbit.utils;

import com.rabbitmq.client.ConnectionFactory;
import org.springframework.beans.factory.annotation.Value;

public class RabbitmqUtil {
    @Value("${spring.rabbitmq.host}")
    private static String host="127.0.0.1";
    @Value("${spring.rabbitmq.port}")
    private static String port="5672";
    @Value("${spring.rabbitmq.username}")
    private static String username="guest";
    @Value("${spring.rabbitmq.password}")
    private static String password="guest";

    public static final ConnectionFactory connectionFactory = new ConnectionFactory();
    static{
        connectionFactory.setHost(host);
        connectionFactory.setPort(Integer.parseInt(port));
        connectionFactory.setVirtualHost("/");
        connectionFactory.setUsername(username);
        connectionFactory.setPassword(password);
    }

}
